<template>
	<!-- 支付成功 -->
	<view class="page">
		<view class="content">
			<view class="box">
				<image src="http://shiliu.gdxuanbao.com/image/paySuccess.png" mode=""></image>
				<text>支付成功</text>
			</view>
		</view>
		<view class="bottom" v-if="type != 0">
			<view class="btn" @click="junit('/pages/prefile/order/order', {type: 0})">
				查看订单
			</view>
			<navigator  open-type="switchTab" url="/pages/index/index">
				<view class="btn">
					回首页
				</view>
			</navigator>
			
		</view>
		<view class="bottom" v-if="type == 0">
		
				<view  class="perfectBtn" @click="perfectAddress">
					去完善收件信息
				</view>
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type: 1 ,//0 未完善地址
				orderId: '',
			};
		},
		methods:{
			perfectAddress(){
				console.log('跳转订单id'+this.orderId);
				this.$Router.replaceAll({
					path: '/pages/prefile/order/orderDetail',
					query: {
						type : 1,//已下单
						orderId :this.orderId ,//有没有地址
					}
				});
			},
			goPerfect(){
				
			},
			goHome(){
				
			},
		},
		onLoad({id,orderId,orderObj,isAddress}) {
			// console.log();
			// console.log('id='+id);
			// console.log('订单对象'+orderObj);
			console.log('订单id'+orderId);
			if(isAddress==0){
				this.type = 0
			}
			if(orderId){
				this.orderId = orderId
				console.log(this.orderId);
			}
		},
		components:{
			
		},
		filters:{
			
		},
	}
</script>

<style lang="scss" scoped>
.page{
	.content{
		height: 370rpx;
		width: 100vw;
		display: grid;
		place-items : center;
		.box{
			display: grid;
			place-items : center;
			image{
				width: 169rpx;
				height: 169rpx;
			}
			text{
				margin-top: 25rpx;
				font-size: 30rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #000000;
			}
		}
	
	}
	.bottom{
		display: flex;
		width: 80%;
		margin: 0 auto;
		justify-content: space-around;
		.btn{
			width: 213rpx;
			height: 63rpx;
			border: 2rpx solid #D2D2D2;
			border-radius: 10rpx;
			display: grid;
			place-items: center;
			font-size: 28rpx;
			color: #919191;
		}
		.perfectBtn{
			width: 286rpx;
			height: 63rpx;
			border: 2rpx solid #FF5113;
			border-radius: 10rpx;
			color: #FF6027;
			display: grid;
			place-items: center;
		}
	}
}
</style>
